<template>
  <div>
    <el-dialog title="生产入库订单详情"  width="1200px" @open="open" class="icon-dialog" :visible.sync="show" :before-close="closeForm" append-to-body>
      <el-form ref="form" :model=" qingsfcinstockform " size="small" label-width="80px" :inline="true" class="header">
        <el-row>
          <el-col :span="8">
            <el-form-item label="日期:" class="no-wrap-label">{{ qingsfcinstockform.orderTime }}</el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="单据类型:" class="no-wrap-label">{{ qingsfcinstockform.type }}</el-form-item>
          </el-col>

        </el-row>

        <br />
      </el-form>

      <el-table :data="qingsfcinstockList" height="calc(100vh - 400px)">
        <el-table-column label="制令单号" width="120" prop="billNo"></el-table-column>
        <el-table-column label="物料名称" width="120" prop="materialName"></el-table-column>
        <el-table-column label="物料编码" width="120" prop="materialNo"></el-table-column>
        <el-table-column label="规格型号" width="120" prop="specification"></el-table-column>
        <el-table-column label="单位名称" width="120" prop="unitName"></el-table-column>
        <el-table-column label="入库数量" width="120" prop="qty"></el-table-column>
        <el-table-column label="仓库" width="120" prop="stock"></el-table-column>
        <el-table-column label="仓位" width="120" prop="location"></el-table-column>
        <el-table-column label="批号" width="120" prop="lot"></el-table-column>

      </el-table>

    </el-dialog>

  </div>
</template>
<script>
import { detail  } from '@/api/app/qingsfcinstock'
export default {
	name:'qingsfcinstockdetail',
	props: {
		show: {
			type: Boolean,
			default: true
		},
		size: {
			type: String,
			default: 'mini'
		},
		info: {
			type: Object,
		},
	},
	data() {
		return {
      qingsfcinstockform:{},
      qingsfcinstockList:[],
		}
	},
	watch:{
		show(val){
			if(val){
			}
		}
	},
	methods: {
    open(){
      detail(this.info).then(res => {
        if (res.status == 200) {
          this.qingsfcinstockform = res.data.data;
          this.qingsfcinstockList = res.data.dataList;

        } else {
          this.$message.error('获取详情失败2，请稍后再试');
        }
      }).catch(error => {

        this.$message.error('获取详情失败，请稍后再试');
      });
    },
    closeForm(){
      this.$emit('update:show', false)
    }
  }
}
</script>
<style  lang="scss">
@import '@/assets/scss/common.scss';

/* 调整表单项间距（按需） */
.el-row {
  margin-bottom: 10px;
}
</style>
